package dao;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.HashMap;
import java.util.Map;

import mysql.MysqlUtil;

import dao.hive.Connect;


public class ResultMap{	
	
	
	public static Map<String, Integer> getMapSet(String tablename, String sql_ref,Connection conn)  throws SQLException {
			String runsql=MysqlUtil.getRunningSql(tablename, sql_ref);
			Map<String, Integer> resultMap = new HashMap<String, Integer>();
			
			Statement sta = conn.createStatement();
			ResultSet rs = sta.executeQuery(runsql);
			
			while(rs.next())
			{
				resultMap.put(rs.getString(1), rs.getInt(2));
			}
		return resultMap;
	}
	
	
}
